package com.yeyks.app.controller.base.order;


import cn.hutool.extra.servlet.ServletUtil;
import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.commonReference.service.order.OrderPayRecordService;
import com.yeyks.order.param.OrderPayRecordC2bCreateOrderPayRecordParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 * 订单支付记录表 前端控制器
 * </p>
 *
 * @author yun
 * @since 2019-07-01
 */
@Api(tags = "订单支付接口", description = "订单")
@RestController
@RequestMapping("/app/orderPayRecord")
public class OrderPayRecordController {

    @Autowired
    private OrderPayRecordService orderPayRecordService;

    @ApiOperation(value = "根据订单生成支付:v3.3")
    @RequestMapping(value = "/c2b/c2bCreateOrderPayRecord", method = RequestMethod.POST)
    public AjaxResponseBody<Map<String, Object>> c2bCreateOrderPayRecord(HttpServletRequest request, OrderPayRecordC2bCreateOrderPayRecordParam param) {
        param.setIp(ServletUtil.getClientIP(request));
        AjaxResponseBody<Map<String, Object>> ajaxResponseBody = orderPayRecordService.c2bCreateOrderPayRecord(param);
        return ajaxResponseBody;
    }

}
